﻿CREATE VIEW [dbo].[ASMS_V_RechargeBill]
	AS 
SELECT RB.*,
	RI.[Name] as RechargeItemName,
	RI.Amount as RechargeItemAmount,
	C.[Name] as CustomerName,
	C.Telephone as CustomerTelephone,
	S1.Name as SalesManagerName,
	MDISP.Name as BoughtChannelName
FROM ASMS_RechargeBill as RB
	left join ASMS_RechargeItem as RI on RI.Id = RB.RechargeItemId
	left join ASMS_Customer as C on C.Id = RB.CustomerId
	left join ASMS_Staff as S1 on S1.Id = RB.SalesManagerId
	left join ASMS_MasterDataItem as MDISP on MDISP.Code = RB.BoughtChannel
